var _ = require("lodash")

var data = {
    news:"",
    comments:"",
}

const reducer = (state=data,action={}) => {
    const {type,payload} = action;
    switch(type){
        case "GETNEWSCOM":
            return Object.assign({},state,{news:payload.data});
        case "GETCOMMENTS":
            return Object.assign({},state,{comments:payload.data});
        default:
            return state;
    }
};

module.exports = reducer;